import { type ContactItemProps } from '@/desktop/logics/contacts'
import { ContactType } from '@/services/contacts'
import ExternalItem from './external'
import GroupItem from './group'
import InternalItem from './internal'

export default function ContactItem(props: ContactItemProps) {
  const { contact } = props

  if (contact.type === ContactType.external) {
    return <ExternalItem {...props} contact={contact} />
  } else if (contact.type === ContactType.group) {
    return <GroupItem {...props} contact={contact} />
  } else {
    return <InternalItem {...props} contact={contact} />
  }
}
